﻿namespace Smart.Service.Class
{
    using Smart.Data.Helper;
    using System;
    using System.Data.SqlClient;

    public class CUSTOMER
    {
        private string m_Address;
        private string m_BusinessLicense;
        private string m_ContactMan;
        private string m_Contents;
        private string m_Email;
        private string m_Fax;
        private int m_Id_Customer;
        private string m_Mobile;
        private string m_NameCompany;
        private string m_TaxID;
        private string m_Tell;
        private string m_Website;

        public CUSTOMER()
        {
            this.m_Id_Customer = 0;
            this.m_NameCompany = "";
            this.m_Address = "";
            this.m_Tell = "";
            this.m_Mobile = "";
            this.m_Fax = "";
            this.m_Website = "";
            this.m_Email = "";
            this.m_TaxID = "";
            this.m_BusinessLicense = "";
            this.m_ContactMan = "";
            this.m_Contents = "";
        }

        public CUSTOMER(int Id_Customer, string NameCompany, string Address, string Tell, string Mobile, string Fax, string Website, string Email, string TaxID, string BusinessLicense, string ContactMan, string Contents)
        {
            this.m_Id_Customer = Id_Customer;
            this.m_NameCompany = NameCompany;
            this.m_Address = Address;
            this.m_Tell = Tell;
            this.m_Mobile = Mobile;
            this.m_Fax = Fax;
            this.m_Website = Website;
            this.m_Email = Email;
            this.m_TaxID = TaxID;
            this.m_BusinessLicense = BusinessLicense;
            this.m_ContactMan = ContactMan;
            this.m_Contents = Contents;
        }

        public string Get(int Id_Customer)
        {
            string str = "";
            string[] myParams = new string[] { "@Id_Customer" };
            object[] myValues = new object[] { Id_Customer };
            SqlHelper helper = new SqlHelper("HPqrGX/piQz0Xe4u/h/67gQ3uyF/l8Jnvceflfn0g5a097J0Dujgoj8bqG7F7buoYB2Mt+NKyXJ77rNdpJJ69tNga+CVb/KOMzARhvb5JWkXymCWnUJWzzgLCgblpEMy", "07071983", true);
            SqlDataReader reader = helper.ExecuteReader("CUSTOMER_GetById", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_Id_Customer = Convert.ToInt32(reader["Id_Customer"]);
                    this.m_NameCompany = Convert.ToString(reader["NameCompany"]);
                    this.m_Address = Convert.ToString(reader["Address"]);
                    this.m_Tell = Convert.ToString(reader["Tell"]);
                    this.m_Mobile = Convert.ToString(reader["Mobile"]);
                    this.m_Fax = Convert.ToString(reader["Fax"]);
                    this.m_Website = Convert.ToString(reader["Website"]);
                    this.m_Email = Convert.ToString(reader["Email"]);
                    this.m_TaxID = Convert.ToString(reader["TaxID"]);
                    this.m_BusinessLicense = Convert.ToString(reader["BusinessLicense"]);
                    this.m_ContactMan = Convert.ToString(reader["ContactMan"]);
                    this.m_Contents = Convert.ToString(reader["Contents"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Address
        {
            get
            {
                return this.m_Address;
            }
            set
            {
                this.m_Address = value;
            }
        }

        public string BusinessLicense
        {
            get
            {
                return this.m_BusinessLicense;
            }
            set
            {
                this.m_BusinessLicense = value;
            }
        }

        public string ContactMan
        {
            get
            {
                return this.m_ContactMan;
            }
            set
            {
                this.m_ContactMan = value;
            }
        }

        public string Contents
        {
            get
            {
                return this.m_Contents;
            }
            set
            {
                this.m_Contents = value;
            }
        }

        public string Email
        {
            get
            {
                return this.m_Email;
            }
            set
            {
                this.m_Email = value;
            }
        }

        public string Fax
        {
            get
            {
                return this.m_Fax;
            }
            set
            {
                this.m_Fax = value;
            }
        }

        public int Id_Customer
        {
            get
            {
                return this.m_Id_Customer;
            }
            set
            {
                this.m_Id_Customer = value;
            }
        }

        public string Mobile
        {
            get
            {
                return this.m_Mobile;
            }
            set
            {
                this.m_Mobile = value;
            }
        }

        public string NameCompany
        {
            get
            {
                return this.m_NameCompany;
            }
            set
            {
                this.m_NameCompany = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class CUSTOMER";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        public string TaxID
        {
            get
            {
                return this.m_TaxID;
            }
            set
            {
                this.m_TaxID = value;
            }
        }

        public string Tell
        {
            get
            {
                return this.m_Tell;
            }
            set
            {
                this.m_Tell = value;
            }
        }

        public string Website
        {
            get
            {
                return this.m_Website;
            }
            set
            {
                this.m_Website = value;
            }
        }
    }
}

